<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" id="input">
<button id="btn">计算</button>
<script>

    document.getElementById('btn').onclick = function () {
        let worker = new Worker('11_worker.js')
        worker.onmessage = function (ev) {
            console.log('html', ev.data)
        }
        console.log(worker)
        worker.postMessage(document.getElementById('input').value)
    }
</script>
</body>
</html>